-
Notifications
You must be signed in to change notification settings - Fork 68
Context autowiring | autoconfiguration #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| ->scalarNode('class')->defaultNull()->end() | ||
| ->scalarNode('environment')->defaultNull()->end() | ||
| ->booleanNode('debug')->defaultNull()->end() | ||
| ->booleanNode('autoconfigure')->defaultFalse()->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess those options are not really related to the kernel configuration, so it should be on the same level with bootstrap and kernel options.
|
|
||
| private function handleAutoConfiguration(ContainerBuilder $container): void | ||
| { | ||
| $container->registerForAutoconfiguration(Context::class)->addTag(self::CONTEXT_TAG); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably won't work, since $container here is Behat's container, not the application's container with all the context services. There's a bundle inside this extension where it is already implemented.
|
@Guikingone Hello, let me know if there is an inspiration to continue your work.) |
Extract magic string 'fob.context' to public constant for better maintainability and discoverability. Based on upstream PR FriendsOfBehat#125 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: prepare for open-source release and Packagist - Update composer.json: new package name (yannickgranger/symfony-extension), keywords, homepage, support links, branch-alias 3.0-dev - Update LICENSE: add fork maintainer copyright - Add CONTRIBUTING.md: development setup, testing, PR guidelines - Add GitHub templates: issue templates, PR template, CODEOWNERS - Add CHANGELOG v3.0.0: document all fork changes, new features, fixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: extract CONTEXT_TAG constant for context autoconfiguration Extract magic string 'fob.context' to public constant for better maintainability and discoverability. Based on upstream PR FriendsOfBehat#125 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add context_discovery option for automatic context detection When enabled, contexts implementing Behat\Context are automatically discovered from the Symfony container without needing explicit behat.yml configuration. Uses autoconfigure to tag Context implementers. - Add DISCOVERED_CONTEXTS_PARAMETER to store discovered context IDs - Store discovered contexts during container compilation - Add context_discovery config option (default: false) - Fall back to discovery when no explicit contexts are available - Explicit contexts still take precedence when configured Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: GRANGER Yannick <ygranger@softwaymedical.fr> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Note: This PR is opened in order to ease the discussions about the implementation, this is a work in progress 🙂